package com.shenghuai.bclient.stores.adapter;

import android.content.Context;

import java.util.List;

public interface IRecyclerAdapter<T> {

    /**
     * Getting context
     *
     * @return context
     */
    Context getContext();

    /**
     * Get the position data
     *
     * @param position position
     * @return T
     */
    T getItem(int position);

    /**
     * Get all the data
     *
     * @return
     */
    List<T> getDataList();

    /**
     * Inserting a series of data
     *
     * @param list       list
     * @param startIndex start index
     */
    void insertItems(List<T> list, int startIndex);

    /**
     * Add a series of data
     *
     * @param list list
     */
    void insertItems(List<T> list);

    /**
     * Inserting a single data
     *
     * @param t        data
     * @param position position
     */
    void insertItem(T t, int position);

    /**
     * add a single data
     *
     * @param t data
     */
    void insertItem(T t);

    /**
     * Replace the whole data
     *
     * @param list list
     */
    void replaceData(List<T> list);

    /**
     * Notification update
     *
     * @param positionStart start position
     * @param itemCount     update count
     */
    void updateItems(int positionStart, int itemCount);

    /**
     * Notification update
     */
    void updateAll();

    /**
     * Remove a item
     *
     * @param position position
     */
    void removeItem(int position);

    /**
     * Remove all
     */
    void removeAll();
}
